package library.mapper;

import library.po.Borrow;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface BorrowMapper {
    /**
     * delete by primary key
     * @param borrowId primaryKey
     * @return deleteCount
     */
    int deleteByBorrowId(Integer borrowId);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(Borrow record);

    /**
     * select by primary key
     * @param userId
     * @return object by primary key
     */
    List<Borrow> selectByUserId(String userId);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateStateByBorrowId(Borrow record);
}